import request from '@/router/axios';
import {downloadExcel} from '@/router/axios';
import {formatCondition} from '@/util/util';
//单条查询
export const queryGeneralProjectPrivilegeRelation = (params) => {
  params.head.transCode = 'queryGeneralProjectPrivilegeRelation';
  return request({
    url: '/general/generalProjectPrivilegeRelation/queryGeneralProjectPrivilegeRelation',
    method: 'post',
    data: params
  })
}
//多条列表查询，支持条件查询
export const queryGeneralProjectPrivilegeRelationListPage = (params) => {
  params.head.transCode = 'queryGeneralProjectPrivilegeRelationListPage';
  return request({
    url: '/general/generalProjectPrivilegeRelation/queryGeneralProjectPrivilegeRelationListPage',
    method: 'post',
    data: params
  })
}
//新增单条记录
export const saveGeneralProjectPrivilegeRelation = (params) => {
  params.head.transCode = 'saveGeneralProjectPrivilegeRelation';
  return request({
    url: '/general/generalProjectPrivilegeRelation/saveGeneralProjectPrivilegeRelation',
    method: 'post',
    data: params
  })
}
//新增多条记录
export const saveGeneralProjectPrivilegeRelationList = (params) => {
  params.head.transCode = 'saveGeneralProjectPrivilegeRelationList';
  return request({
    url: '/general/generalProjectPrivilegeRelation/saveGeneralProjectPrivilegeRelationList',
    method: 'post',
    data: params
  })
}
//新增或修改单条记录
export const saveOrUpdateGeneralProjectPrivilegeRelation = (params) => {
  params.head.transCode = 'saveOrUpdateGeneralProjectPrivilegeRelation';
  return request({
    url: '/general/generalProjectPrivilegeRelation/saveOrUpdateGeneralProjectPrivilegeRelation',
    method: 'post',
    data: params
  })
}


//新增或修改单条记录
export const saveOrUpdateGeneralProjectPrivilegeRelationList = (params) => {
  params.head.transCode = 'saveOrUpdateGeneralProjectPrivilegeRelationList';
  return request({
    url: '/general/generalProjectPrivilegeRelation/saveOrUpdateGeneralProjectPrivilegeRelationList',
    method: 'post',
    data: params
  })
}

//修改单条记录
export const updateGeneralProjectPrivilegeRelation = (params) => {
  params.head.transCode = 'updateGeneralProjectPrivilegeRelation';
  return request({
    url: '/general/generalProjectPrivilegeRelation/updateGeneralProjectPrivilegeRelation',
    method: 'post',
    data: params
  })
}

//删除单条记录
export const deleteGeneralProjectPrivilegeRelation = (params) => {
  params.head.transCode = 'deleteGeneralProjectPrivilegeRelation';
  return request({
    url: '/general/generalProjectPrivilegeRelation/deleteGeneralProjectPrivilegeRelation',
    method: 'post',
    data: params
  })
}

//删除多条记录
export const deleteGeneralProjectPrivilegeRelationList = (params) => {
  params.head.transCode = 'deleteGeneralProjectPrivilegeRelationList';
  return request({
    url: '/general/generalProjectPrivilegeRelation/deleteGeneralProjectPrivilegeRelationList',
    method: 'post',
    data: params
  })
}
//导出excel
export const exportGeneralProjectPrivilegeRelationExcel = (params) => {
  downloadExcel({
    url: '/general/generalProjectPrivilegeRelation/excelDownload/exportGeneralProjectPrivilegeRelationExcel',
    method: 'get',
    data: 
    {
      tenantId: params.head.tenantId,
      orders:'',
      condition: formatCondition(params.body.sqlCondition)
    }
  })
}
